package com.demo.eshop.pdetail.controller;

import com.demo.eshop.pdetail.entity.User;
import com.demo.eshop.pdetail.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: e20160504
 * @date: 2018/10/17
 * @desc
 */

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping
    public User get() {
        return userService.getUserInfo();
    }

    @GetMapping("/cache")
    public User getCacheUser(){
        return userService.getCacheUserInfo();
    }
}
